<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('仓库信息列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            <label for="wareName">仓库名称：</label>
                            <input type="text" name="wareName" id="wareName"/>
                        </li>
                        <li>
                            <label for="brandName" >商品品牌：</label>
                            <input type="text" name="brandName" id="brandName"/>
                        </li>
                        <li>
                            <label for="typeName" >商品类型：</label>
                            <input type="text" name="typeName" id="typeName"/>
                        </li>
                        <li>
                            <label for="productModelName" >商品名称：</label>
                            <input type="text" name="productModelName" id="productModelName"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('storage:kc:edit')}]];
    var removeFlag = [[${@permission.hasPermi('storage:kc:remove')}]];
    var detailFlag = [[${@permission.hasPermi('storage:kc:detail')}]];
    var prefix = ctx + "storage/kc";

    function numFormat(num) {
        var c = (num.toString().indexOf ('.') !== -1) ? num.toLocaleString() : num.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,');
        return c;
    }

    function editStatus(status,id){
        $.ajax({
            type : "get",
            url : ctx + "storage/ck/edit",
            data: {
                "status" : status,
                "ckId" : id
            },
            dataType : "json",//预期服务器返回的数据类型
            success : function () {
                $.modal.alertSuccess("更改成功");
                $.table.refresh();
            },
            error : function (){
                $.modal.alertError("更改有误！");
            }
        })
    }

    $(function() {
        // location.reload();
        // $.table.refresh();
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{status}/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            detailUrl: prefix + "/detail/{id}",
            modalName: "出库信息",
            columns: [{
                checkbox: true
            },
                {
                    field: 'ckcId',
                    title: '编号',
                    visible: false
                },
                {
                    title: "序号",
                    formatter: function (value, row, index) {
                        return $.table.serialNumber(index);
                    }
                },
                {
                    field: 'wareName',
                    title: '仓库名称'
                },
                {
                    field: 'brandName',
                    title: '商品品牌',
                },
                {
                    field: 'typeName',
                    title: '商品类型'
                },
                {
                    field: 'productModelName',
                    title: '商品名称'
                },
                {
                    field: 'firmName',
                    title: '厂商名称'
                },
                {
                    field: 'kcNum',
                    title: '商品数量',

                },
                {
                    field: 'unit',
                    title: '单位',

                }]
        };
        $.table.init(options);


    });



</script>
</body>
</html>